﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Http;

using API.Models;
using API.Models.Repository;

namespace API.Controllers.api
{
    public class OutgoingInvoicesCommerceMLController : BasicController
    {
        public void Post(IEnumerable<V_OutgoingInvoices> value)
        {
            var repository = new OutgoingInvoices_Repository();
            repository.SetSession(this.currentSession);

            value.ToList().ForEach(r =>
            {
                r.GUID_RECORD = Guid.NewGuid();

                repository.Add(r);
                repository.Save();
                repository.Recode(r.GUID_RECORD);
            });
        }    
    }
}
